<?php

class Joinus extends CI_Controller {
	
	function __construct(){
	
		parent::__construct();
		
		$this->load->model('registration_m');
		
		
	}
	

	function index(){
		// this load the view for registration page..
		$data = array(
			'title' => 'JOIN US TODAY!'
		);
		$this->load->view('joinus/includes/header',$data);
		$this->load->view('joinus/registration');
		$this->load->view('joinus//includes/footer');
		
		
	}
	function reg(){
		// save the data..
		
		$res = $this->registration_m->save_new();
		
		if($res){
		
			$data = array(
                   'username'  => $this->input->post('email'),
                
               );
			$this->session->set_userdata($data);
			
			redirect('accounts');
		}
		else{
			show_error('Error email or password not match');
		}
		
	}

}// end joinus controller..